<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组合继承</title>
</head>
<body>
    <script>
        function Foo(name,age){
            this.name = name;
            this.age = age;
        }

        Foo.prototype.getName = function(){
            console.log(this.name);
        }

        function Fpp(name,age,price){
            Foo.call(this,name,age);
            this.price = price;
        }

        Fpp.prototype = new Foo();
        Fpp.prototype.constructor =Fpp;
        Fpp.prototype.setName = function(name){
            this.name =name;
        }

         var fpp =new Fpp("Tom",12,12345);
         fpp.getName();
         fpp.setName("Jack");
         fpp.getName();
    </script>
</body>
</html>